package com.ruoyi.duanju.controller.my;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.duanju.domain.DjDuanju;
import com.ruoyi.duanju.domain.DjInputFileDetail;
import com.ruoyi.duanju.service.IDjDuanjuService;
import com.ruoyi.duanju.service.IDjInputFileDetailService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("duanju/my/api")
public class MyApiController extends BaseController {

    @Autowired
    IDjDuanjuService djDuanjuService;

    @Autowired
    IDjInputFileDetailService iDjInputFileDetailService;

    @GetMapping("/list")
    public TableDataInfo list(DjInputFileDetail detail)
    {
        startPage();
        List<DjInputFileDetail> list = iDjInputFileDetailService.selectDjInputFileDetailList(detail);
//        List<DjDuanju> list = djDuanjuService.selectDjDuanjuList(djDuanju);
//        if(StringUtils.isNotEmpty(djDuanju.getTitle()) && CollectionUtils.isEmpty(list)){
//            //查询第三方数据库
//            list = iPlaywrightService.search(djDuanju.getTitle());
//        }
        return getDataTable(list);
    }
}
